package fr.univnantes.lina.ftbcleaner;

import java.util.Map;

import fr.univnantes.lina.ftbcleaner.FTBPropertiesMultiWordCompiler;

public class DesambiguateUtil extends FTBPropertiesMultiWordCompiler {

	public DesambiguateUtil() {
		super();
	} 

	
	/**
	 * return true if The First Form is More Salient Than Others Based On FB Heuristic
	 * 
	 */
	public static Boolean isTheFirstFormMoreSalientThanOthersBasedOnFBHeuristic(
			Map<String, Integer> map) {
				int valueOftheFirst = 0;
				int sumOfTheRest = 0;
				int j = 0;
				for(Map.Entry<String,Integer> entry : map.entrySet()) {
					//		String key = entry.getKey();
					Integer value = entry.getValue();
					if (j>0) sumOfTheRest +=  value;
					else valueOftheFirst = value;
					j++;
					//System.out.println(key + " => " + value);
				}
			
				// if the FB heuristic fires
				return (valueOftheFirst > sumOfTheRest);
			}

}